package com.hspedu.threaduse;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/3/10
 * @time 18:09
 */
public class JavaTest {
    private volatile static boolean flag = false;
    public static void main(String[] args) throws InterruptedException {
        new Thread(() ->
        {
            while (!flag) {
            }
            System.out.println("你能看见我吗");
        }).start();

        Thread.sleep(2000);
        flag = true;
    }
}
